<template>
  <div id="app">
    <!-- 添加加载指示器 -->
    <div v-if="loading" class="app-loading">
      <div class="loading-content">
        <div class="spinner"></div>
        <p>正在加载...</p>
      </div>
    </div>
    
    <!-- 主要内容 -->
    <router-view v-else />
  </div>
</template>

<script>
import { ref, onMounted } from 'vue'

export default {
  name: 'App',
  setup() {
    const loading = ref(true)
    
    onMounted(() => {
      // 模拟加载过程，1秒后显示主要内容
      setTimeout(() => {
        loading.value = false
        console.log('Vue应用加载完成')
      }, 1000)
    })
    
    return {
      loading
    }
  }
}
</script>

<style>
#app {
  min-height: 100vh;
  background: #f4f5f7;
}

.app-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.loading-content {
  text-align: center;
  color: white;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
</style> 